/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Microsoft YaHei", "Heiti SC", sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
header {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

header h1 {
    color: #2c3e50;
    margin-bottom: 10px;
}

header p {
    color: #7f8c8d;
}

/* 主要内容区 */
main {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

@media (min-width: 768px) {
    main {
        grid-template-columns: 2fr 1fr;
    }
}

/* 计算器部分 */
.calculator {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.input-section, .result-section {
    margin-bottom: 20px;
}

.input-section h2, .result-section h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

/* 关系链展示 */
.relation-chain {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    min-height: 50px;
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 15px;
}

.relation-item {
    display: flex;
    align-items: center;
    margin-right: 10px;
    margin-bottom: 10px;
}

.relation-label {
    padding: 5px 10px;
    background-color: #3498db;
    color: white;
    border-radius: 4px;
}

.relation-arrow {
    margin: 0 5px;
    color: #95a5a6;
}

/* 关系选择区 */
.relation-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
}

.relation-selector {
    display: flex;
    gap: 10px;
    flex-grow: 1;
}

select, button {
    padding: 8px 12px;
    border-radius: 4px;
    border: 1px solid #ddd;
}

select {
    flex-grow: 1;
}

button {
    background-color: #3498db;
    color: white;
    border: none;
    cursor: pointer;
    transition: background-color 0.3s;
}

button:hover {
    background-color: #2980b9;
}

#clearRelations {
    background-color: #e74c3c;
}

#clearRelations:hover {
    background-color: #c0392b;
}

/* 结果区域 */
.result {
    padding: 15px;
    background-color: #f9f9f9;
    border-radius: 4px;
    margin-bottom: 15px;
}

.result-detail {
    margin-bottom: 10px;
}

.result-label {
    font-weight: bold;
}

.result-value {
    font-size: 1.2em;
    color: #2c3e50;
}

.result-chain {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 15px;
}

/* 关系解释区域样式 */
.result-explanation {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px dashed #ddd;
}

.result-explanation h3 {
    font-size: 1em;
    color: #2c3e50;
    margin-bottom: 10px;
}

.result-explanation p {
    margin-bottom: 8px;
    font-size: 0.9em;
}

.result-explanation strong {
    color: #2c3e50;
}

.original-path {
    text-decoration: line-through;
    color: #e74c3c;
}

.simplified-path {
    color: #27ae60;
    font-weight: bold;
}

/* 常见称呼部分 */
.common-relations {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.common-relations h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #ecf0f1;
}

.relation-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
}

.common-relation-item {
    padding: 10px;
    background-color: #f9f9f9;
    border-radius: 4px;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s;
}

.common-relation-item:hover {
    background-color: #e0e0e0;
}

/* 页脚样式 */
footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    color: #7f8c8d;
}

footer a {
    color: #3498db;
    text-decoration: none;
} 